<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>话题列表 - 社交广场</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome 图标 -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    
    <style>
        :root {
            --primary: #4285F4;
            --secondary: #8E24AA;
            --success: #0F9D58;
            --warning: #FF9800;
            --danger: #F44336;
            --text-primary: #202124;
            --text-secondary: #5F6368;
            --text-tertiary: #9AA0A6;
            --bg-light: #F8F9FA;
            --bg-white: #FFFFFF;
            --border-light: #E0E0E0;
            --radius: 12px;
            --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding-top: 56px;
            padding-bottom: 70px;
        }
        
        /* 顶部导航 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 56px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            z-index: 1000;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }
        
        .nav-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
        }
        
        .nav-btn {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 20px;
        }
        
        /* 搜索栏 */
        .search-container {
            padding: 12px 16px;
            background-color: var(--bg-white);
            border-bottom: 1px solid var(--border-light);
        }
        
        .search-box {
            position: relative;
        }
        
        .search-input {
            width: 100%;
            padding: 10px 16px 10px 40px;
            border-radius: 24px;
            border: 1px solid var(--border-light);
            background-color: var(--bg-light);
            font-size: 14px;
            outline: none;
        }
        
        .search-icon {
            position: absolute;
            left: 14px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
        }
        
        /* 分类标签 */
        .category-tabs {
            display: flex;
            background-color: var(--bg-white);
            padding: 8px 16px;
            overflow-x: auto;
            scrollbar-width: none;
            border-bottom: 1px solid var(--border-light);
        }
        
        .category-tabs::-webkit-scrollbar {
            display: none;
        }
        
        .category-tab {
            padding: 6px 16px;
            white-space: nowrap;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-secondary);
            background: none;
            border: none;
            border-radius: 16px;
            margin-right: 8px;
            flex-shrink: 0;
        }
        
        .category-tab.active {
            color: var(--primary);
            background-color: rgba(66, 133, 244, 0.1);
        }
        
        /* 话题列表容器 */
        .topics-container {
            padding: 12px 16px;
        }
        
        /* 话题卡片通用样式 */
        .topic-card {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 16px;
            overflow: hidden;
            transition: transform 0.2s ease;
        }
        
        .topic-card:hover {
            transform: translateY(-2px);
        }
        
        /* 话题头部 */
        .topic-header {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .topic-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .topic-creator {
            flex: 1;
        }
        
        .creator-name {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 2px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .creator-badge {
            font-size: 10px;
            padding: 1px 5px;
            border-radius: 4px;
            background-color: var(--primary);
            color: white;
        }
        
        .topic-time {
            font-size: 12px;
            color: var(--text-tertiary);
        }
        
        /* 话题内容 */
        .topic-content {
            padding: 0 16px 12px;
        }
        
        .topic-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 8px;
            line-height: 1.5;
        }
        
        .topic-text {
            font-size: 15px;
            color: var(--text-secondary);
            margin-bottom: 12px;
            line-height: 1.6;
        }
        
        /* 话题图片样式 - 单图 */
        .topic-single-image .topic-images {
            margin-bottom: 12px;
            border-radius: 8px;
            overflow: hidden;
        }
        
        .topic-single-image .topic-image {
            width: 100%;
        }
        
        .topic-single-image .topic-image img {
            width: 100%;
            height: auto;
            display: block;
        }
        
        /* 话题图片样式 - 多图 */
        .topic-multi-image.two-images .topic-images {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .topic-multi-image.three-images .topic-images {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .topic-multi-image.three-images .topic-images div:nth-child(3) {
            grid-column: 1 / 3;
        }
        
        .topic-multi-image.four-images .topic-images {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            border-radius: 8px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        
        .topic-multi-image .topic-image {
            aspect-ratio: 1/1;
            overflow: hidden;
            position: relative;
        }
        
        .topic-multi-image .topic-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        /* 无图话题 */
        .topic-no-image .topic-content {
            padding-bottom: 16px;
        }
        
        /* 话题标签 */
        .topic-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 12px;
        }
        
        .topic-tag {
            padding: 4px 10px;
            background-color: var(--bg-light);
            border-radius: 16px;
            font-size: 12px;
            color: var(--primary);
        }
        
        /* 话题数据统计 */
        .topic-stats {
            display: flex;
            justify-content: space-between;
            padding: 8px 16px;
            border-top: 1px solid var(--border-light);
            font-size: 13px;
        }
        
        .topic-stat {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-tertiary);
        }
        
        /* 话题操作按钮 */
        .topic-actions {
            display: flex;
            justify-content: space-around;
            padding: 8px 0;
            border-top: 1px solid var(--border-light);
        }
        
        .topic-action {
            flex: 1;
            padding: 8px 0;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        
        .topic-action:hover, .topic-action.active {
            color: var(--primary);
        }
        
        /* 热门话题样式 */
        .trending-topics {
            background-color: var(--bg-white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            margin-bottom: 16px;
            padding: 16px;
        }
        
        .trending-title {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--danger);
        }
        
        .trending-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        
        .trending-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }
        
        .trending-rank {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: var(--bg-light);
            color: var(--text-tertiary);
            font-size: 12px;
            font-weight: 600;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        
        .trending-rank.top3 {
            background-color: var(--danger);
            color: white;
        }
        
        .trending-content {
            flex: 1;
        }
        
        .trending-topic {
            font-size: 15px;
            font-weight: 500;
            margin-bottom: 4px;
        }
        
        .trending-meta {
            font-size: 12px;
            color: var(--text-tertiary);
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        /* 底部导航 */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 70px;
            background-color: var(--bg-white);
            display: flex;
            justify-content: space-around;
            align-items: center;
            border-top: 1px solid var(--border-light);
            z-index: 1000;
        }
        
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: var(--text-tertiary);
            font-size: 11px;
            gap: 4px;
            text-decoration: none;
            flex: 1;
        }
        
        .nav-item.active {
            color: var(--primary);
        }
        
        .nav-icon {
            font-size: 22px;
        }
        
        /* 创建话题按钮 */
        .fab-create {
            position: fixed;
            right: 24px;
            bottom: 86px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            background-color: var(--primary);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
            border: none;
            font-size: 24px;
            z-index: 999;
        }
        
        /* 提示消息 */
        .toast {
            position: fixed;
            bottom: 90px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 8px 16px;
            border-radius: 6px;
            z-index: 9999;
            font-size: 14px;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .toast.show {
            opacity: 1;
        }
        
        /* 加载更多 */
        .load-more {
            width: 100%;
            padding: 12px;
            border-radius: 8px;
            background-color: var(--bg-white);
            border: 1px solid var(--border-light);
            color: var(--text-primary);
            font-size: 15px;
            margin-top: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
    </style>
</head>
<body>
    <!-- 顶部导航 -->
    <div class="top-nav">
        <button class="nav-btn" id="backBtn">
            <i class="fas fa-arrow-left"></i>
        </button>
        <div class="nav-title">话题广场</div>
        <button class="nav-btn" id="messageBtn">
            <i class="far fa-bell"></i>
        </button>
    </div>
    
    <!-- 搜索栏 -->
    <div class="search-container">
        <div class="search-box">
            <i class="fas fa-search search-icon"></i>
            <input type="text" class="search-input" placeholder="搜索话题或内容...">
        </div>
    </div>
    
    <!-- 分类标签 -->
    <div class="category-tabs">
        <button class="category-tab active">推荐话题</button>
        <button class="category-tab">热门讨论</button>
        <button class="category-tab">科技</button>
        <button class="category-tab">娱乐</button>
        <button class="category-tab">体育</button>
        <button class="category-tab">美食</button>
        <button class="category-tab">旅行</button>
        <button class="category-tab">教育</button>
    </div>
    
    <!-- 话题列表容器 -->
    <div class="topics-container">
        <!-- 热门话题区域 -->
        <div class="trending-topics">
            <div class="trending-title">
                <i class="fas fa-fire"></i>
                <span>今日热门话题</span>
            </div>
            <div class="trending-list">
                <div class="trending-item">
                    <div class="trending-rank top3">1</div>
                    <div class="trending-content">
                        <div class="trending-topic">#新一代人工智能技术发展趋势#</div>
                        <div class="trending-meta">
                            <span><i class="fas fa-comment"></i> 2.5万讨论</span>
                            <span><i class="fas fa-eye"></i> 36.8万浏览</span>
                        </div>
                    </div>
                </div>
                <div class="trending-item">
                    <div class="trending-rank top3">2</div>
                    <div class="trending-content">
                        <div class="trending-topic">#夏日旅行最佳目的地推荐#</div>
                        <div class="trending-meta">
                            <span><i class="fas fa-comment"></i> 1.8万讨论</span>
                            <span><i class="fas fa-eye"></i> 28.3万浏览</span>
                        </div>
                    </div>
                </div>
                <div class="trending-item">
                    <div class="trending-rank top3">3</div>
                    <div class="trending-content">
                        <div class="trending-topic">#年度最佳电影评选#</div>
                        <div class="trending-meta">
                            <span><i class="fas fa-comment"></i> 1.2万讨论</span>
                            <span><i class="fas fa-eye"></i> 21.5万浏览</span>
                        </div>
                    </div>
                </div>
                <div class="trending-item">
                    <div class="trending-rank">4</div>
                    <div class="trending-content">
                        <div class="trending-topic">#健康饮食小技巧分享#</div>
                        <div class="trending-meta">
                            <span><i class="fas fa-comment"></i> 9.8千讨论</span>
                            <span><i class="fas fa-eye"></i> 15.2万浏览</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 多图话题 -->
        <div class="topic-card topic-multi-image four-images">
            <div class="topic-header">
                <img src="https://picsum.photos/id/64/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">
                        旅行摄影爱好者
                        <span class="creator-badge">达人</span>
                    </div>
                    <div class="topic-time">今天 09:45</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">分享一组上周去青海湖拍摄的照片，真的太美了！</div>
                
                <div class="topic-text">
                    青海湖的美是无法用语言形容的，湖水的颜色会随着光线变化而呈现出不同的蓝色，远处的雪山和油菜花田相映成趣，随手一拍都是壁纸级别的照片。强烈推荐大家夏季去看看！
                </div>
                
                <div class="topic-images">
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/10/600/600" alt="话题图片1">
                    </div>
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/15/600/600" alt="话题图片2">
                    </div>
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/28/600/600" alt="话题图片3">
                    </div>
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/42/600/600" alt="话题图片4">
                    </div>
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#青海湖旅行#</span>
                    <span class="topic-tag">#风光摄影#</span>
                    <span class="topic-tag">#夏季旅行#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>12.5k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>328 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action active">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (1.2k)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 单图话题 -->
        <div class="topic-card topic-single-image">
            <div class="topic-header">
                <img src="https://picsum.photos/id/91/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">美食家小李</div>
                    <div class="topic-time">昨天 18:23</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">自己在家做的红烧肉，味道不输餐厅！</div>
                
                <div class="topic-text">
                    周末在家尝试做了红烧肉，按照网上的教程一步步来，没想到第一次就这么成功！肉质软糯，肥而不腻，甜咸适中。分享一下做法：...
                </div>
                
                <div class="topic-images">
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/292/800/500" alt="话题图片">
                    </div>
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#家常菜#</span>
                    <span class="topic-tag">#红烧肉#</span>
                    <span class="topic-tag">#美食分享#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>8.7k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>456 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (856)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 无图话题 -->
        <div class="topic-card topic-no-image">
            <div class="topic-header">
                <img src="https://picsum.photos/id/22/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">
                        科技前沿观察
                        <span class="creator-badge">官方</span>
                    </div>
                    <div class="topic-time">3天前</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">大家觉得下一代智能手机会有哪些革命性的功能？</div>
                
                <div class="topic-text">
                    随着科技的发展，智能手机更新换代越来越快。从折叠屏到屏下摄像头，从AI助手到卫星通信，手机功能越来越强大。那么大家觉得下一代智能手机会有哪些突破性的创新？是全场景AR交互，还是更长的续航，或者是全新的形态？欢迎讨论分享你的想法！
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#智能手机#</span>
                    <span class="topic-tag">#科技预测#</span>
                    <span class="topic-tag">#未来科技#</span>
                    <span class="topic-tag">#产品创新#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>23.6k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>1,256 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (3.2k)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 两图话题 -->
        <div class="topic-card topic-multi-image two-images">
            <div class="topic-header">
                <img src="https://picsum.photos/id/65/100/100" alt="用户头像" class="topic-avatar">
                <div class="topic-creator">
                    <div class="creator-name">健身达人小张</div>
                    <div class="topic-time">4天前</div>
                </div>
            </div>
            
            <div class="topic-content">
                <div class="topic-title">坚持健身一年的前后对比，付出总会有回报！</div>
                
                <div class="topic-text">
                    一年前决定开始健身，从一个健身小白到现在养成了运动习惯。这一年里，不仅身材有了明显变化，身体素质也提高了很多，精神状态也更好了。分享一下对比图，激励正在健身或准备开始健身的朋友们！
                </div>
                
                <div class="topic-images">
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/177/600/600" alt="健身前">
                    </div>
                    <div class="topic-image">
                        <img src="https://picsum.photos/id/176/600/600" alt="健身后">
                    </div>
                </div>
                
                <div class="topic-tags">
                    <span class="topic-tag">#健身#</span>
                    <span class="topic-tag">#自律#</span>
                    <span class="topic-tag">#健身成果#</span>
                </div>
            </div>
            
            <div class="topic-stats">
                <div class="topic-stat">
                    <i class="fas fa-eye"></i>
                    <span>18.9k 浏览</span>
                </div>
                <div class="topic-stat">
                    <i class="fas fa-comment"></i>
                    <span>987 评论</span>
                </div>
            </div>
            
            <div class="topic-actions">
                <button class="topic-action active">
                    <i class="far fa-heart"></i>
                    <span>喜欢 (5.7k)</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="topic-action">
                    <i class="fas fa-share-alt"></i>
                    <span>分享</span>
                </button>
                <button class="topic-action">
                    <i class="far fa-bookmark"></i>
                    <span>收藏</span>
                </button>
            </div>
        </div>
        
        <!-- 加载更多 -->
        <button class="load-more" id="loadMoreBtn">
            <i class="fas fa-spinner fa-spin"></i>
            <span>加载更多话题</span>
        </button>
    </div>
    
    <!-- 创建话题按钮 -->
    <button class="fab-create" id="createTopicBtn">
        <i class="fas fa-plus"></i>
    </button>
    
    <!-- 底部导航 -->
    <div class="bottom-nav">
        <a href="#" class="nav-item">
            <i class="fas fa-home nav-icon"></i>
            <span>首页</span>
        </a>
        <a href="#" class="nav-item active">
            <i class="fas fa-comments nav-icon"></i>
            <span>话题</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-compass nav-icon"></i>
            <span>发现</span>
        </a>
        <a href="#" class="nav-item">
            <i class="fas fa-user nav-icon"></i>
            <span>我的</span>
        </a>
    </div>
    
    <!-- 提示消息 -->
    <div class="toast" id="toast"></div>
    
    <!-- Bootstrap JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // DOM元素
        const backBtn = document.getElementById('backBtn');
        const messageBtn = document.getElementById('messageBtn');
        const createTopicBtn = document.getElementById('createTopicBtn');
        const loadMoreBtn = document.getElementById('loadMoreBtn');
        const categoryTabs = document.querySelectorAll('.category-tab');
        const topicActions = document.querySelectorAll('.topic-action');
        const searchInput = document.querySelector('.search-input');
        const toast = document.getElementById('toast');
        
        // 显示提示消息
        function showToast(message) {
            toast.textContent = message;
            toast.classList.add('show');
            
            clearTimeout(toast.timeout);
            toast.timeout = setTimeout(() => {
                toast.classList.remove('show');
            }, 2000);
        }
        
        // 分类标签切换
        categoryTabs.forEach(tab => {
            tab.addEventListener('click', function() {
                categoryTabs.forEach(t => t.classList.remove('active'));
                this.classList.add('active');
                showToast(`已切换到 ${this.textContent}`);
            });
        });
        
        // 话题操作按钮
        topicActions.forEach(action => {
            action.addEventListener('click', function() {
                const icon = this.querySelector('i');
                const text = this.querySelector('span').textContent;
                
                // 喜欢按钮切换状态
                if (icon.classList.contains('far') && icon.classList.contains('heart')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    this.classList.add('active');
                    // 更新数字
                    let countText = text.match(/\d+/)[0];
                    let newCount = parseInt(countText) + 1;
                    this.querySelector('span').textContent = text.replace(countText, newCount);
                    showToast('已点赞');
                } else if (icon.classList.contains('fas') && icon.classList.contains('heart')) {
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    this.classList.remove('active');
                    // 更新数字
                    let countText = text.match(/\d+/)[0];
                    let newCount = parseInt(countText) - 1;
                    this.querySelector('span').textContent = text.replace(countText, newCount);
                    showToast('已取消点赞');
                } 
                // 收藏按钮
                else if (icon.classList.contains('far') && icon.classList.contains('bookmark')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas');
                    this.classList.add('active');
                    showToast('已收藏');
                } else if (icon.classList.contains('fas') && icon.classList.contains('bookmark')) {
                    icon.classList.remove('fas');
                    icon.classList.add('far');
                    this.classList.remove('active');
                    showToast('已取消收藏');
                } 
                // 评论按钮
                else if (icon.classList.contains('far') && icon.classList.contains('comment')) {
                    showToast('进入评论区');
                } 
                // 分享按钮
                else if (icon.classList.contains('fas') && icon.classList.contains('share-alt')) {
                    showToast('分享功能');
                }
            });
        });
        
        // 搜索功能
        searchInput.addEventListener('keyup', function(e) {
            if (e.key === 'Enter' && this.value.trim()) {
                showToast(`搜索: ${this.value}`);
            }
        });
        
        // 加载更多
        loadMoreBtn.addEventListener('click', function() {
            this.innerHTML = '<i class="fas fa-spinner fa-spin"></i><span> 加载中...</span>';
            setTimeout(() => {
                this.innerHTML = '<i class="fas fa-plus"></i><span> 加载更多话题</span>';
                showToast('已加载更多话题');
            }, 1500);
        });
        
        // 其他按钮事件
        backBtn.addEventListener('click', () => showToast('返回上一页'));
        messageBtn.addEventListener('click', () => showToast('查看消息通知'));
        createTopicBtn.addEventListener('click', () => showToast('创建新话题'));
        
        // 初始化
        function init() {
            // 初始化操作
        }
        
        init();
    </script>
</body>
</html>
